
#ifndef __MOTOR_H__
#define __MOTOR_H__

#include "define.h"

//select MOTOR CONTROLER
#define MOTOR_CTRL_33886
//#define MOTOR_CTRL_L298


class motor
{
public:
  enum motor_status {FORWARD, REVERSE, FREE_RUN, FAST_STOP};

public:
  //motor();
  void set_status_L(motor_status status);
  void set_status_R(motor_status status);
  
  motor_status get_status_L(){ return m_status_L;}
  motor_status get_status_R(){ return m_status_R;}
  
  void set_speed_L(xuint8 speed);
  void set_speed_R(xuint8 speed);
  
  xuint8 get_speed_L(){ return m_speed_L;}
  xuint8 get_speed_R(){ return m_speed_L;}
  
private:
  void init();

private:
  motor_status m_status_L;
  motor_status m_status_R;
  
  xuint8 m_speed_L; //expectant speed
  xuint8 m_speed_R;
};


#endif